Preheat the oven to 375F.
Grease a loaf pan.
Pan-fry the onions in the oil. (Or caramelize them if you have the time and inclination.)
Beat the eggs, cottage cheese, and milk together in a large bowl.
Add the remaining ingredients, except the ketchup, and mix well.
Pack the mixture into the loaf pan.
Spread ketchup on top.
Bake uncovered in 375F oven for 45min.