Refactor router to allow params from custom routes