The SharePoint API offers a great way to modifiy and create SharePoint content. You only need to be aware of the following restrictions:
You need to run the code on the front-end server on which you want to use the API on. Otherwise use the SharePoint web services.
The user executing the code must be be farm administrator.
The user executing the code must have the following permissions on the database:
Configuration database: Pulic, wss_content_application_pools
Content database: db_owner
Admin content database: Public
If this can be done there is nothing in the way using the SharePoint API. Remember to use the Dispose pattern for the SPSite and SPWeb objects.
To access a site you may use this code:
SPSite site = new SPSite("url");
SPWeb web = site.OpenWeb();
Note: Never, ever dispose the SPContext.Current.Web.