PLD: remove api code from main