Refactored Appointment rest api.