Rewrite API wit models