@classmethod
def _canonicalize_url(cls, url):
    """ If using caterogies, return the category-less URL

        eg:
          - category URL: https://example.com/project/dev/foobar/
          - category-less URL: https://example.com/projects/foobar/

        API endpoints are reachable only for category-less URLs.
        """
    m = cls.REGEX_CATEGORY_PROJECT_URL.match(url)
    if m:
        return '{base_url}/projects/{project_name}'.format(**m.groupdict())
    else:
        return url
