added optional params to get appointments