change to_json to get_resource