refactored routes to use controllers