refactor and build tests
Refactored controllers, wrote tests, fixed checkin#create & checkin#update