def page_exists(request_dict):
    """
    Checks if page exists given the parsed request body

    Parameters
    ----------
    request_dict : dict
        request output after parsing

    Returns
    -------
    bool
        if the page exists

    """
    if 'error' in request_dict: # when using parse
        raise ValueError("This query does not correspond to a Wikipedia page.")
        return False
    elif 'query' in request_dict: # when using query
        page =  request_dict["query"]["pages"]
        pageid = list(page.keys())[0]
        if 'missing' in page[pageid]:
            raise ValueError("This query does not correspond to a Wikipedia page.")
            return False
    return True