Added a deviceCount field to project which is updated when devices are registered and disconnected.
Added sanity check for deviceCount and fixed test data.