Fix build for current api

Change set fixes error msg pull from response for json request and api error test cases that were not calling the api to produce the expected error.