Hello Binoj D,
Thanks for this. Gives me a chance to stumble and trip....to learn something along the way, cool.
OK. My understanding is that you need to aim to evolve the core API...bit of mimicry required. The main reason for this, arguably, is to do with accessibility and fitness for purpose both in terms of the user. So, in other words, refactoring in view of your spec. I hear the name of it should drive your development, or at least might be helpful for you and in the long-term for the Moodle quiz feature.
Developing an API....might be akin to the detail/info in the following thread:
I would suggest having a look at that thread, specifically for some pointers.
A bit limited in terms of knowledge/support here, but may be useful.
On another note, it doesn't seem to me that you just get new questions from another source and insert into the moodle database-STACK plays a part too....and less is more, because you can always add to the api...but tricky to undo it.
Cheers, ( I am sure I will be corrected, if wrong-please ;)