More API work/code cleanup