Hi Maqsood,
an alternative way to build your own import tool could be based on creating a new REST service (a new Web Script) that can be invoked remotely from your custom client directly using HTTP.
This service could get contents from your external app and importing all the contents, please remember to disable the transaction element in the Web Script descriptor:
<transaction>none</transaction>
In this way if the batch will return an error you will find all the imported contents correctly inside Alfresco. Otherwise Alfresco Web Scripts by default exposes transactionally all the operations this means that if an error is returned for a single content, Alfresco will rollback all the imported contents removing all the imported nodes.
You can implement your Web Script using the JavaScript API or the Java API of Alfresco:
JavaScript examples:
Please see the Upload example that can help you.
Or you can take a look at the Java-Backed Web Scripts:
Hope this helps.