moved api code to separate file and interface