Various API improvements