Tsg cleanup

Treat OOM in TSG and correctly handle HTTP body data.