Modified how API calls are handled