g.json is per request and modifications you may perform won't have an effect outside the request either.  I suggest you remove the call to copy()