In a large bowl, beat the eggs and sour cream until smooth.
In a separate bowl, whisk the flour, salt, and baking powder together. Add the eggs and sour cream, stirring until the dough starts to come together.
Turn the dough out onto a clean surface and knead until smooth. Cover with a damp cloth and let the dough rest for 20 minutes. It can even be refrigerated for up to 48 hours.
Divide the dough in half and roll out to ⅛" thickness on a lightly floured surface. Cut into circles with a 3-inch round biscuit cutter.
Make the filling by melting the butter in a small pan. Add the chopped onion and saute for 5-7 minutes until soft. Add the onions to the mashed potatoes, stirring to combine.
Place about 1 ½ teaspoons of filling in the middle of each round of dough. Use your finger to moisten the edges around half of each round with water, then fold over and seal the edges well by pressing them with your fingers or crimping with a fork.
Bring a large pot of salted water to a boil. Add the pierogies, about 10-15 at a time, and cook for 2-3 minutes, until the pierogi float to the top. Remove the cooked pierogi from the water with a slotted spoon and transfer to a plate. Drizzle with 2 tablespoons of the melted butter so they don't stick to each other while you boil the remaining pierogi.
Heat a large skillet over medium-high heat and add any remaining butter. Fry the pierogi in batches for 2-3 minutes on each side until golden brown. Serve with sour cream.