fixed saving device service and env through api
Merge pull request #1133 from mkurek/fix/api-device-save-service-env

fixed saving device service and env through api