followed from http://spring.io/guides/gs/rest-service/