Added  AJAX funtionality to the friendship Model.