appointment booking API logic