Soak 1 cup of the grated coconut in 1 cup of warm water for 30 minutes and grind it in a blender. Strain and reserve the liquid. Then add 2 cups of water to the same coconut and grind. Strain and reserve the liquid separately.
Heat 1 tablespoon of oil in a pan and fry the remaining grated coconut for 5 minutes over low heat. Remove and keep aside.
Add another tablespoon of oil in the same pan and fry the red chilies, cinnamon, cloves, coriander, cumin, mustard, fenugreek, peppercorns & turmeric for 1 minute.
Grind these fried spices with fried coconut, tamarind & half of the chopped onions in 1/2 cup of second part of the coconut milk. Grind it into a smooth paste.
Heat oil in a large pan and fry the remaining onions until golden and add the ground spice paste with little water and fry for 3 minutes. Then add the chicken pieces and fry for few more minutes. After that add the second part of coconut milk and salt. Add 1 cup of water. Cook over low heat, until the chicken is 3/4 cooked. Then add the first part of the coconut milk and curry leaves and boil for 5 minutes. Serve hot.