updated api and tests accordingly