ZEN-8688: Set status BEFORE beginning to write response body.