events api cleanup