changed the router to run off server variables