Added friend model and modified the logic for angular controllers