throw a runtimeException if data passed to fromJson method isn't json