Add the error code into the JSON response

Add the HTTP response code into the JSON error response