Fix object registration to be compatible with the dor-service

I updated the registration object function. Some code has been duplicate between here and dor-service registration_service