cleaner way to query db

all db query functions now may return dbStatus code to pass error back

also fix #10