implemented some basic functions and apis