Hardening the error response, now replacing tick (') characters to return valid JSON