Split dev and prod dbs, fixed some bugs