Refactored upload service into REST api