(task) Modifications in backend to allow complex SQL queries to be built