Reworked most of the API.