API endpoint for signing (bug 958337)

work in progress, not for merging yet...