More Api methods and some refactoring