- Root cause: accessing req.get("dataset_ids") returns None when the key is absent, causing KeyError. - Fix: use req.get("dataset_ids", []) to default to empty list.