Modified the query to get trends in pipeline

* Fixed concatenation issues in the query variable in pipeline
* In app.py finished writing the route to get trends