There are a number of YouTube videos that suggest removing the batteries, then washing the keyboard in a dishwasher without soap (and without JetDry please), then drying it for four days or so in a warm location. I don't think I'd go so far as to put it in a dishwasher, but you could put it in a container and add distilled water, then press each key a few times to help the water circulate underneath each key to help wash away whatever gunk you spilled on the keyboard. Change the water and do it a couple more times to remove as much of the sticky stuff as possible. Then dry for four days in a warm area, or use the 'put it in a bag with rice' trick. I'd do this only if I'd given up and was ready to buy a new keyboard. Sort of a last ditch attempt to try to save the keyboard. If all else fails, take it completely apart and sell the pieces on eBay to others who need the parts!
Run hot water on the metal around the stuck endcap. You are attempting to heat up this area to get the aluminum to expand a bit. Be careful not to get water into the keys. I was able to successfully unscrew a stuck endcap with this technique.