added implementation of streams for file and req