updated routes to res.json