define and implement an algorithm to construct Panda API instances