added functions to perform DB queries and parse responses to string