Added validation to REST service