further work on api (wip)