This is one of my favorite things about the Flavour framework: strongly-typed web service calls:
https://frequal.com/Flavour/book.html#org44d6b49
Your single-page app code calls your backend API using strong types. Your code is clean and the framework handles marshaling and unmarshalling JSON.