Slice 2 of the onions thinly and chop the other two into fine dice.
To make the batter, whisk together the flour, baking powder, salt, sugar and chilli flakes. Add the water until you have a smooth batter.
Stir in the onions and feta cheese.
Heat approximately 2cm of oil in a large frying pan and fry tablespoons of the batter until crisp and golden on both sides. Remove and allow to drain on kitchen paper. Continue until all the batter has been cooked.
In the meantime, combine all the ingredients for the dipping sauce in a saucepan and allow to boil for 5-10 minutes or until the sauce is the consistency of maple syrup.