Reverted response handling.

Caused too many conflicts with other methods. Clean up should be done before the stop method is called.
JSON method should send a clean response.