Add test for api error response