Curl errors to client, fix headers to support gzip