Better checking of type sent to jsoninterceptor