Add update endpoint to API

These changes are completely untested and should not be merged yet. The pull request is just FYI.