add streaming api support

TODO test