extending API and bug fixes