For collecting data and sending it to the stream API