Fixed the API error response to the correct format