api failure bug fix