Remove to_json methods and add json getter.