Updated code with the latest stream API. Updated event stream with data: prefix