Added list patients functionality
fixed bugs from previous commit