Add update endpoint to API

These changes are completely untested and should not be merged yet. The pull request is just FYI.
twisted imports should go after stdlib imports