Support both Promise based and node callback API