app.route('/<major>/')

def major_res(major):
    course_list = list(client.db.course_col.find({'major': major.encode(
        'utf8', 'ignore').upper()}))
return flask.Response(response=json.dumps(course_list), status=200,
    mimetype='application/json')
Flask Display Json in a Neat Way