api development
some refactorings