fixing double call to API