Is it worth trying to remove this class and use JResponseJson now it exists (https://github.com/joomla/joomla-cms/blob/master/libraries/cms/response/json.php) - it's 100% the same - but they're doing pretty much the same job