title: My API endpoint is not returning the expected output
body: <p>I have written a backend app with Express JS to retrieve info from a database through GET requests from an API endpoint. The query that I have used to GET from API endpoint is working in the Database , but I could not fetch the same details in a Web Browser as Response using Express JS. Tried my best to find out the issue, but I couldn't.</p>
  
  <p>I tried to check whether I had a problem with my query, but the query is fetching the correct details, but I couldn't get any response in the web browser.</p>
  
  <p>Here is my code where I think I had a bug :</p>
  
  <pre><code>      const { rows } = await pool.query(
                  'SELECT  branches.ifsc, branches.bank_id, branches.branch, branches.address, branches.city, branches.district, branches.state FROM branches WHERE branches.branch LIKE $1% LIMIT $2 OFFSET $3' ,
  
          [q, limit, offset]
        );
  
        res.send(rows[0]);
      });
  </code></pre>
  
  <p>SQL Query used to Fetch Details:</p>
  
  <pre><code>    SELECT branches.ifsc, branches.bank_id, branches.branch, branches.address, branches.city, branches.district, branches.state FROM branches WHERE branches.branch LIKE '%RTGS%' ORDER BY branches.ifsc LIMIT 3;
  </code></pre>
  
  <p>Error Log:</p>
  
  <pre><code>Server is running on 7000
  (node:19484) UnhandledPromiseRejectionWarning: error: syntax error at or near "LIMIT"
      at Connection.parseE (/home/kiddo/Desktop/backend/node_modules/pg/lib/connection.js:604:11)
      at Connection.parseMessage (/home/kiddo/Desktop/backend/node_modules/pg/lib/connection.js:401:19)
      at Socket.&lt;anonymous&gt; (/home/kiddo/Desktop/backend/node_modules/pg/lib/connection.js:121:22)
      at Socket.emit (events.js:200:13)
      at addChunk (_stream_readable.js:294:12)
      at readableAddChunk (_stream_readable.js:275:11)
      at Socket.Readable.push (_stream_readable.js:210:10)
      at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
  (node:19484) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  (node:19484) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>