FEMA was merged into the department in a massive federal restructuring after the September 11 , 2001 terrorist attacks .