Added events api (unfinished)