js: add member method for resource on routes