Yep good luck Livo, the main things i have found important is stable oil temp, using a fair amount gives better temperature stability and also the consistancy of the mix, mixing all the spices including the salt and let the salt draw out the water from the onions, ...then add the gram and rice flour or whatever you are using until you have a sticky mix, golf ball size dollops in my experience has been best.
Give em all a short dip until light gold and fish them out, they will still cook for a bit, then give them all a second go to finish no more than 4 /5 at a time. good luck