Bugfixes and updates
Pendingcheck API addition for checking number of pending messages