implementation of rest and persistence layer.