Javascript updated to display error messages on friend request failure