updated routing and controller functions