Added method to serialise AnyRef to JSON as an event