Bug when app name and resource name are the same

This fixes a bug where app name and resource name are the same. 

uri: /projects/api/v1/projects/1/

should return: projects/1/

NOT: projects/api/v1/projects/1/