Improvemens on resource service.
Add comments on resource.js