Changed the query functions to accept paramaters to filter the searches by the arguments passed through the endpoints.