Refactoring routes to use resources and confirms edit function