old_contents: import json
  from flask import Response
  
  
  def build_response(output, status=200, mimetype='application/json',
                     headers={}):
      return Response(
          json.dumps(output),
          mimetype=mimetype
      ), status, headers
  
new_contents: import json
  from flask import Response, jsonify
  
  
  def build_response(output, status=200, mimetype='application/json',
                     headers={}):
      resp = jsonify(output)
      resp.mimetype = mimetype
      return resp, status, headers
  
subject: Fix issue with datetime handling