DS-1945 refactor to move code into dspace-api