Added code for insertQuery method.
Added code for getQueries method.