implemented getProfiles

function returns the the list of profiles listed by the directory in
json.