Got db layer working.