title: Object of type 'TypeError' is not JSON serializable
body: <p>I try to build API with Django rest framework</p>
  
  <p>And I got Object of </p>
  
  <pre><code>type 'TypeError' is not JSON serializable
  </code></pre>
  
  <p>What should I do to fix?</p>
  
  <p>Here's my <code>view.py</code></p>
  
  <pre><code>class NewsViewSet(viewsets.ModelViewSet):
      queryset = News.objects.all()
      serializer_class = NewsSerializer
  
      def list(self, request, **kwargs):
          try:
              nba = query_nba_by_args(**request.query_params)
              serializer = NewsSerializer(nba['items'], many=True)
              result = dict()
              result['data'] = serializer.data
              result['draw'] = nba['draw']
              result['recordsTotal'] = nba['total']
              result['recordsFiltered'] = nba['count']
              return Response(result, status=status.HTTP_200_OK, template_name=None, content_type=None)
  
          except Exception as e:
              return Response(e, status=status.HTTP_404_NOT_FOUND, template_name=None, content_type=None)
  </code></pre>