new api almost complete