Added errorchecking in admin api