Completed the conversion for the new web api for main and spawn