c# version of APIwrapper