message refactoring - added message types and byte payload, EndpointMessageListener fixes and synchronisation