To interaction with the dtime API via Javascript, you need to be able to chain together API calls in a straightforward manner.
Hypermedia APIs rely on state machine logic - given a current state, there are a number of transitions you can make (Valid HTTP verbs on the available rels)
In the code, transition(current_state, rel, opts)
is our way to transition.