Use ngResource instead of $http and remove setTimeout

Fix issues #1 Use ngResource instead of low level service $http
Fix issues #2 setTimeout should be replaced by $timeout in
TestController.js