added auditing and abstracted out API calls