New follow routine with streaming API, and fixed problems with writing to files