Refactored location factory and both api v1 locations controller and api v1 photos controller