Added unique id to input channel
Fixed ToJson (with error propagation)