add controller code and tests for appointments