In the REST API documentation, I didn't see an option to create an account. Obviously then, the code snippet here to create an account has to be front-ended by some other API so that a request to create an account can be catered to. I am not sure why this is so. Is there a
HTTP POST REST API to create an account?
Also, normally, to build a REST interface, one starts with identifying all 'resources' whose state changes over time and can be changed in a state-less operation. Then, for every such resource, the CRUD operations are implemented. For example, in Stellar, the resources could be account, anchor, trustlines, transactions, etc.