new api refactor