Enabled deleting pages logic and backend refactoring