added api for passing credentials