I think there's already some code in the invenio.utils.datacite module which you can fix up and remove