Call a JSON API with auth, timeouts and retries

The API here is a stand-in that runs in the page: POST ./api/notes with a bearer token demo-token.

What happened