added emitToggle on api