Added security rules, default actions and corrected the code to fit changes in other modules.