refactored routes to use resources