accepted and pending friend logic moved from view to controller