Added db queries for appointments