made jquery api emit events