fix(rest) save file stream: write.on(open) -> read.on(end)