refactored routes and added controllers