API improvements

@adgad  - adding you as a reviewer as the only other person to work with the code.