updated routes to send JSON to template