update route and router to support notfound and error handlers