Improved API and documentation