Introduced error handling, and API for organization