I have done this, but its not as straightforward as it feels it should be. From memory if you just use the simple api service then whilst it creates a site it does not create all the "stuff" that Share needs to show it.
Using the reporsitory browser, navigate to your api created site and in another browser window navigate to a "share" created site. I suspect that your site will be missing quite a few folders and files.
You definitely can create sites using the API, I have done it via CMIS (using PHP) and I have my own "create sites" option on my own dashlet which is javascript (this is essentially a variation on the "My Sites" dashlet for which you have the source code on your server by definition).
Bob Johnson