add a message entity and use it in the client

the value cannot now be null but can be 0 or negative