@staticmethod
def _parse_error(response):
    """
        Parses any version of the API payload when the status code is != 200

        :param response: a response object
        :return: Error message
        """
    if response.headers.get('Content-Type') == 'application/json':
        try:
            payload = response.json()
            if 'msg' in payload:
                return payload['msg']
            elif 'error' in payload and 'message' in payload:
                return payload['error'] + '. ' + payload['message']
            elif 'error' in payload:
                return payload['error']
        except ValueError:
            return None
