More work on the API, especially the binary API