moved json-generating to Event-class