Added support different Node API. Tested on >0.11 and 0.8 - 0.10