change to_json to  as_json