1) Use mel. Theres no point in doing 400 lines of code and then imoplement undo in another 800 sorry.
2) Same answer.
Thing is if you do this sort of stuff you use mel. Even tough you call and embed the mell in api compiled binary. MEl and api dont overlap so you can nopt just go geez i know how to do this in mel lets do it faster in api. It wont work, because its not faster (crating nodes or connections is not faster in api just logic evaluation of pure code computation), and its 20 times slower to develop and even then you can not do the same things even if you wanted to.
So the only reason youd use api is IF:
1) your implementing a new node type
2) your making a exporter /importer
3) your doing a convoluted data transformation (in which case you should use a node)
4) your trying to mask what your doing (no point tough since in this case the connections are shown anyway)
5) your doing a renderer
See the best use of maya api is the fact that you rarely need to use it to the tasks you think you do. The top 1 thing aboutknowing your doing something worng is if:
1) you register a event thats not encaplulsated in the MPxNode
2) your doing a MPxCommand
See:
http://www.creativecrash.com/forums/api/topics/new-to-the-api-then-read-this-33