Add API and cleanup. Code-complete.