Added JSON serialization.