Add 'update' option for PUT instead of POST.
Fix error handling.