Fix API key deletion logic