Working on API and storing the events