Output error message on failure. If DEBUG enabled, output response body if api error.