A simple way to do rest requests in angularjs