Syntax error in the sql query. Fixed it and testing the route now.