code: function normalizeResource(resource) {
      if (!resource) {
        return resource;
      }
      var i = resource.indexOf('/');
      if (i === -1) {
        return resource.toLowerCase();
      }
      return resource.substring(0, i).toLowerCase() + resource.substring(i);
    }
docs: normalizeResource lowercases the first segment of the given resource. subresources can be case-sensitive.