Man barricaded in apartment opens fire on NYPD