JSON - Encoding and Decoding Custom Types