implement generic repository and add service layer