you should :
* no use "elseif" because you have check with "canCreateServiceWithName"
* throw exception after "elseif"

But should not return null ?