JSON serialization code stuff.