Complete register function in the backend.