More API docs and cleanups