API docs and cleanup