Is there any way through with I can call a restfull api whenever any change is made to a defect or a user story?
Unfortunately this isn't possible. You may wish to check the answer to this question:
Listen for Rally Defect Status Change
Which has a good discussion of this topic.