updated api after massive code restructure