updated routes, models, and middleware