Add function and route for question 3