Add getting and setting of entity count