add json() method to event