Add HTTP error code to JSON error response object