api changes to handle events