API for control.php