More fixes on client api, fixed issue with malformed token