Updated router to read headers