Data is now appropriately cast before encoding JSON.