fix routes and move to controllers file