rest: use function jsonError
rest: return 404 when no subscriptions
rest: upser subscriptions