Finished function for adding and removing friends on the webpages