Cleanup names api and api value code. Add alias check for delete