fixed Overwrite bug. Now database can write more than one query. Connection and init logic were moved to the models controller