json handling of events