Fix the routes so they handle the promise properly