Refactor ticket API to stabilise calling conventions