How to export projects with it's subprojects?

Hi Ann,
When I use sonar_url/api/index/status , it lists all the project keys and measures but I wanted to know how can I segregate and export the projects and subprojects.?
Do I have to export even the sub-projects as well?
I am creating a custom solution which will export the projects such that it can be accommodated in an individual instance. We currently have a single instance for all the projects. We are in a migration phase and require a technique to do this easily with api.
Thank you

Regards,
Yash Brahmani