Load apps and rules from the database