Improve API and documentation