fixed api and refactoring start functions