api controller and utility for killing active loops