protected function _call_api( $method, $url, $params ) {
        $raw_response = $this->_client->$method($url, $params);
        $info = $this->_client->get_info();
        if ($info['http_code'] != null) {
            switch ($info["http_code"]) {
                case 200:
                case 202:
                    $response = json_decode($raw_response);
                    break;
                    /*
                case 400:
                    throw new MalformedRequestException();
                case 401:
                    throw new AuthenticationFailedException();
                case 404:
                    throw new ResourceNotFoundException();
                case 500:
                    throw new InternalServerErrorException();
                case 503:
                    throw new ServiceTemporarilyUnavailableException();
                    */
                default:
                    throw new \Exception("Error: {$info['http_code']}", $info['http_code']);
            }
        }

        return $response;
    }