better use of hypermedia in TypeScript client