fix memory issues for data_stream
create/fix api