code: def serialize(self):
          
  
          if self.request is None:
              request = None
          else:
              request = json.loads(self.request)
  
          if self.response is None:
              response = None
          else:
              response = json.loads(self.response)
  
          return {
              'id': self.id,
              'name': self.name,
              'request': request,
              'response': response
          }
docs: serialize.