code: private function outputTxt($aOut)
      {
          $oOutput = Factory::service('Output');
          $oOutput->set_content_type('text/html');
          if (Environment::not(Environment::ENV_PROD) && defined('JSON_PRETTY_PRINT')) {
              return json_encode($aOut, JSON_PRETTY_PRINT);
          } else {
              return json_encode($aOut);
          }
      }
docs: Formats $aOut as a plain text string formatted as JSON (for easy reading)
  but a plaintext contentType
  
  @param  array $aOut The result of the API call
  
  @return string