Magnetic Adsorbates on Metal Substrates: Magnetic Anisotropy and Switching of the Kondo State