Writing data to database; need to separate that logic into a separate module, and then test the entire thing