Flask REST API: result is not getting displayed as ValueError: View function did not return a response : <p>I am facing problem when deploying a text summarizer (LexRank) through Flask RESTful API. Please see below my code snippet</p>

<pre><code>@app.route('/response/',methods = ['GET','POST'])
def response():
if request.method=='POST':
    text_org = request.json['foo']# I have defined this 'foo' in JQuery in UI
    text = json.loads(json.dumps(text_org))
    text = re.sub('[^A-Za-z0-9()[].]', ' ', str(text))
    text = text.lower()        
    if len(text.split())&lt;=3:
        resp = ' '.join(['please give some more sentences.'])
        return resp
    else: 
        summarizer = LexRankSummarizer()
        parser = PlaintextParser.from_string(text,Tokenizer('english'))
        sum_1 = summarizer(parser.document,5)
        sum_lex=[]
        for sent in sum_1:
            resp_raw = sum_lex.append(str(sent))
            resp = ' '.join(resp_raw)
            return jsonify(resp)
</code></pre>

<p>After running this (with <code>len(text) &gt; 3</code>) I am getting the following error</p>

<pre><code>builtins.TypeError
TypeError: can only join an iterable
</code></pre>

<p>However, when I run a non Flask version of the above code, my result is coming properly. 
Can anybody please help? </p>
