Parsing chat message and storing in chats table