Use promise to handle nodejs async calls.