services.js improvements