updated backend to process hashes and more generally chats