add a message entity and use it in the client

constructor is changed