Added api response and error renderer.

Moved modules. Close connection after request has been fulfilled.