adding handling for api error messages in java-jaxrs template