jaxrs: make sure not to write null entities in the JSON bodies

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>