added intial javascript for expanding query, fecthing results from server