Function toBalances

Convert backend API result to library result object to return in Client.getBalances method

Error - If input parameter is not array