Code for the Kandy API