restapi: Improve details helper

This patch improves the details helper so that details can be included and
excluded.

Change-Id: I31e10aa2df770dbb957586a6791766f72d324dfe
Related-To: Bug-Url: https://bugzilla.redhat.com/1132249
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>