We should really consider having an higher level structure for sending ws messages, so we could manage things like errors in a single place, and taking care of JSON serialization for example

But probably in a another PR