Improving API + AngularJS test