Fix bug 34242 by chunking POST response from services and removing last 2 chunks as response body and header block. Also updated import/export tests to check if state = finished immediately before looping to wait.