change routes for chat : put them after /api
load old message in chat when change room, sort messages and don't add duplicates to chat