Added the ability to encode Values to json