var certificates = JSON.parse(value),
	result = {
		response: {
			'@status': 'success',
			data: []
		}
	};

if (certificates.response['@status'] !== 'success') {
	certificates.response.data = [];
	return JSON.stringify(certificates);
}

if (certificates.response.result && certificates.response.result.certificate && certificates.response.result.certificate.entry) {
	result.response.data = Array.isArray(certificates.response.result.certificate.entry) ? certificates.response.result.certificate.entry : [certificates.response.result.certificate.entry];

	return JSON.stringify(result);
}

return JSON.stringify(result);