changed db to pg, added models tests