Created repository mocks and fixed most tests