Adapting to new api