completed rest service and added tests