database queries and serialized saving of options