made doRequest method to make calling queries on db easier