def _get_response(self, method, endpoint, data=None):
        """
        Helper method for wrapping API requests, mainly for catching errors
        in one place.

        :param method: valid HTTP method
        :type method: str
        :param endpoint: API endpoint
        :type endpoint: str
        :param data: extra parameters passed with the request
        :type data: dict
        :returns: API response
        :rtype: Response
        """
        url = urljoin(IVONA_REGION_ENDPOINTS[self.region], endpoint)

        response = getattr(self.session, method)(
            url, json=data,
        )

        if 'x-amzn-ErrorType' in response.headers:
            raise IvonaAPIException(response.headers['x-amzn-ErrorType'])

        if response.status_code != requests.codes.ok:
            raise IvonaAPIException(
                "Something wrong happened: {}".format(response.json())
            )

        return response
Helper method for wrapping API requests, mainly for catching errors
        in one place.

        :param method: valid HTTP method
        :type method: str
        :param endpoint: API endpoint
        :type endpoint: str
        :param data: extra parameters passed with the request
        :type data: dict
        :returns: API response
        :rtype: Response