change chat route to return json