refactored routes to call controllers