add chunked decoding and test for it