[BUGFIX] Only render "id" if applicable

Fixes the previous commit that issued an exception
when a resource didn't point to an object but for example
to an array.