Implement JSON serialization