basic JSON response working

using dbQuery method, abstracts the database connection and allows user
to use by just passing queries. It automatically connects and ends
connections as needed