Change serialization method from json to struct. Less hacky and saves on a bit of traffic.