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 in the header too.  Sorry for the comment here instead of higher up, it won't let me comment up there since it's not part of the diff.