Added saving resources to the database.