add save method to document
database is a class variable