angularJS vs rest API ex1