addressed some issues when sending json objects when strings were expected
function to copy a streams source and reuse it with different size constraints