restapi: Avoid NPE when enum has no value

The mechanism that we currently use to validate enum values donsn't take
into account that the values may be null. When this happens a NPE is
triggered and logged, instead of generating a user friendly message.
This patch changes the validation logic so that it will generate a
reasonable error message.

Change-Id: Ie8e2ba41729bcbbf5b24a64e51dd258c039bed4e
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>