Update and fix API (and documentation)