Connecting and storing to db (prototype)