Note: Work in progress, need to jot down for future reference.
When migrating content from the old system to Drupal, we need some programmatic way of doing that. If we did some Google search with keyword such as "programmatic Drupal", two methods become obvious - node_save() and drupal_execute(). Before we go further, better to clarify that both methods are not exactly some kind of Data API that Drupal provide to programmaticaly import external data. It far from that. It just happened that we can leverage both functions to help us put external data in place within Drupal structure.