def errCheck(response):
    """  Checks errors in response from Anki connect and returns appropriate message

    Parameters:
        response (JSON): URL where media is located

    Returns:
        False if no error.
        Error message string otherwise.
    """

    if len(response) != 2:
        return'response has an unexpected number of fields'
    if 'error' not in response:
        return 'response is missing required error field'
    if 'result' not in response:
        return 'response is missing required result field'
    if response["error"] != None:
        return response["error"]
    return False