added the ability to actually modify the database. Most functions except images now work