Improve id field detection

Check whether shape has the supposed id field (coming from resources.json) - if not try by prepending the type name.