Last I checked, while you can make API calls in client-side of web templates, you cannot make API calls from Server-side templates and I'm not sure if this has changed.
@@matheskan there used to be a way using context.services.http.something (like put, post, etc.). Salesforce removed the documentation and typedocs but in theory it still is on serverside