making the api a standard node api, rather than promise based