Fixes error when services don't exist

Checks that services exist before iterating over the categories.