Refactored routes to use resources