Still working on the DB layer

Darn thing doesn't stop crashing. But I feel the end is getting closer
^^