re-org
using $q service for $http and abstracting restful js api for other services to interact with