Split json encoder from decoder