fixed var name
moved 404/405 from router to function