changes to_json to as_json