Working bug add/edit.
Fixed logging and added loadDB function.