In deep baking dish, arrange alternate layers of ham and apples. Sprinkle each layer with onion and seasonings. Moisten each layer with bouillon. Over top, cover with layer of thick mashed potatoes. Brush potato peaks with melted butter. Bake at 325 degrees for 1 1/2 to 2 hours until ham is thoroughly heated and potato peaks are browned.