resourceUrl function refactors nested resource methods