User Answers

In a true OO-fashion, you should use private properties for that. Available anywhere within your (instantiated) class, but not for the 'outside' world.

The Write obj.%ToJSON() writes to the TCP stream of the HTTP Response, the headers are written before the body.

You' have to call the ReportHttpStatusCode first (which is nothing more then:  Set %response.Status=HttpStatus) and then write the body.