State takes over nursing home said to endanger patients