Write some API documentation; Cleanup