New York declares state of emergency as heavy rains wreak havoc