demo adapted to new api