Refactored out all http requests into angular factory