Template to use the new api in models