Use JSON.generate to properly quote JS string