Update service.js to slightly newer API