fix events api and add withStream