using jax-rs serialization instead of forcing in code