Wrote the saveDB method

Exceptions need to be covered, but I'm not sure if it's necessary to have them there, we can talk about it later.