Refactored routes and more tests written