Improve API, adjust docs.