refactor($resource): simplify url template expansion