API and other bugfixes