a bunch of API improvements