refactor js responses for appointments and offices