Started working on new query method
Completed new query function in Flask views