Added config variable to set maximum number of attempts that the service makes requests to the REST server, and corresponding logic to work() method.
Fixed typo in function signatures.
Added logging; removed devel as a dependency.