add contacts API and test code