fix transform streams to passthrough for error, add mapping function
simplify api with a transform stream, document mapping function