Hi emin
I can never resist an onion bhaji question!
The sweetness comes from the onions as does most of the taste. I think you could make some okay bhajis just using onions gram flour and a bit of ground coriander.
The only way to get the sweet taste out of the onions is to deep fry them up to about 60% cooked and leave them at room temperature for 5 or 6 hours (like every BIR in the country does). They will taste much more authentic after the second fry, plus they will be soft and well cooked all the way through.
If the ones from the t/a tasted good then ask what they put in them, most will be happy to tell you. If not, try balancing the spices yourself but less is usually more. The only essentials for me are ground coriander, turmeric, cumin seeds, fresh coriander and a hint of chilli powder. Once you have the method right, you can start looking into which spices work best for you.