Stack trace exposure
It seems that you are returning a stack trace to the user. We recommend that you use exception handling and send an error message to the user.
@app_flask.route('/noncompliant/<text>')
def stack_trace_exposure_noncompliant(text):
    try:
        if text == 'error':
            raise HTTPException
        return jsonify({'data': 'some_data'}), 200
    except HTTPException:
        # Noncompliant: Stack trace is returned from api call.
        return traceback.format_exc()
@app_flask.route('/compliant/<text>')
def stack_trace_exposure_compliant(text):
    try:
        if text == 'error':
            raise HTTPException
        return jsonify({'data': 'some_data'}), 200
    except HTTPException:
        # Compliant: Custom json response with message as cause of error.
        return jsonify({'message': 'Internal error occurred!'}), 404