api functionality almost ready