Corrected name of api in error return
Moved admin actions to api and converted to new database object