refactored routes and controller for readability over D.R.Y.
refactored routes and controller for readability over D.R.Y.