Tweak preferences window
Add API key save
Remove extra code