Implemented chat:get_messages/1 and chat:get_messages/2