code: def json_api_call(req_function):
      
      @wraps(req_function)
      def newreq(request, *args, **kwargs):
          outp = req_function(request, *args, **kwargs)
          if issubclass(outp.__class__, HttpResponse):
              return outp
          else:
              return '%s' % json.dumps(outp, cls=LazyEncoder)
      return string_to_response("application/json")(newreq)
docs: Wrap a view-like function that returns an object that
          is convertable from json