Refactoring routes to use resources
updated