Function toStats

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