Make sure you have appropriate surf-config setup for your site presets. Check the link given above. If you use the above given surf-config as is, it will setup surf config for default site preset always. so make sure you make changes accordingly and bootstrap the surf-config.
Check this class and bean definition which is used to import surf-config for default site.
If you are using default site preset (i.e. 'site-dashboard') provided by alfresco, you can use this OOTB rest api which creates the site and setup surf-config by default. If you are using default site preset, then writing a custom webscript for creating site is not required.