add code for streaming api