unit tests

more tests! also removed some repetitive code. Still trying to figure
out how to mock validation errors coming from entity framework.