1) add RestClient error code to api, 2) trying to make tests work