Ajax request 500 interval error
<p>I am using Python Flask framework to build my website. I try to use ajax call to get server response and result in 500 internal error.</p>

<p><strong>app.py</strong></p>

<pre><code>from flask import Flask, render_template,request
@app.route(''+'/api/suggest/')
def api():
   pass
</code></pre>

<p><strong>index.js</strong></p>

<pre><code>new Ajax.Request('api/suggest/',{
    method: 'get',
    onSuccess: function(response) {
        alert(response);
    }
});
</code></pre>

<p><a href="http://localhost:5000/api/suggest/" rel="nofollow">http://localhost:5000/api/suggest/</a> returns 500 Internal server error</p>

<blockquote>
  <p>Failed to load resource: the server responded with a status of 500
  (INTERNAL SERVER ERROR)</p>
</blockquote>