Parent page id should be set when using the createNewPage method.
Also, parent_page_id should only be changed if the variable isset, otherwise it should be left alone.