You don't need to use API calls to dynamically create menu items (or delete them) if you can wait a few hours when I get back from work I will post the code here