add event handler blocks
remove legacy api.