re-organized api related stuff