Change as_json to as_dict