LL-269 #close Added a logic to check for entity still being used.

The solution is far from being perfect and all the entities have to be
interated in order to make a decision, but there did not seems to be any
other way. As that only happens during removal it should not probably be
such a big deal. Also added a couple of changes to the service, so that
the short URI form would alway be used for type attribute.