Include response code in error responses

This change ensures that the response_code is returned in the initial error responses if it's available. The code that was there was failing because it expected the response_code to be available in $response['body']['response_code'] when it's actually in $response['body']['data']['response_code'].