Replace single quotes during JavaScript object generation in frontend