added events, and serialization to json and saving to file