decorate api methods with error catching