Add ticket close api endpoint

Also adds end-to-end testing of ticket update, close, stat