added JSON classes and event framework