add router to middleware stack