add json serialization for events