Separated API from the project, bugfixes