fix has_monitoring_datasets for empty dict and add test case