Added exception handling to repository and service layer. Refactored base repository for clearer seperataion of persistence.