Refactorization part 2.6
Added some more stuff to the API.