Polish API and write docs.