Use API to fetch the unread counts

Since API supports social features it makes sense to use it to fetch the unread counts.