implemented sendMessage
implemented getMessages