implement the new api and model