Add event class and use it to send messages
It would be easier to offload the event content to to a different class and use it, instead of using a struct.
We shall also use the event object to report events in the future instead of passing the json text.