API changes and fixes

Removed some elements of the API and reorganized it.