Fix members and owners insertion
Change interaction with database