test JSON serialization