add api project and fixed bugs