Added global ballot stats API. Fixed NPE on datastore access.