refactor, started api