Adds error handing

Fixes the issue where calling a contact that doesn’t exist does not
return anything.