Small bugfixes in template rest service.