Correct coding convention and replace json_encode to G::json_encode and json_decode to G::json_decode