Nan/Nani
Nan and Nani are essentially the same word and are interchangeable. Thing is that the Japanese tend to sometimes drop off the last vowel sound of a word, often saying things like "des" instead of "desu", "ich" instead of "ichi", and "nan" instead of "nani". I don't think it's grammatically incorrect either way, it's mainly what pronunciation is smoother for the sentence it is used.
For example, if you are just saying "What?", then it would be "Nani". If you are saying "What is it?" it would be "Nan des ka?" (spelled to show the the dropped vowel sounds). You will be understood either way, most likely.