Add debugging statements to ap_monitor.py