Contacts API returns 404 for non-existing contact. Minor refactor