Switch to json encoding