added countAll and countByTag methods to connection classes