api: allow to retrieve resources details when listing

This allow to list resources via the generic type endpoint with adding
either ?details=true in the query or Accept: details=true in the headers.

Change-Id: I3c5dee4b0693f1234dff6137a6cb98b235a13143