building a rest application in java