updated api and tests