returns detail, list or aggregates

def determine_end_point(http_request, url):
    """
    returns detail, list or aggregates
    """
    if url.endswith('aggregates') or url.endswith('aggregates/'):
        return 'aggregates'
    else:
        return 'detail' if is_detail_url(http_request, url) else 'list'