API enhancements and bug fixes