Add update endpoint to API

These changes are completely untested and should not be merged yet. The pull request is just FYI.
Since you've had a couple merges in here you'll probably want to add a license line for Ambient here too.