refactoring the server to send a ServerMessage to the client
adding update type to ChatMessage