proper json result for api error