Implement JSON serialization for request and response