doge api added to before_saves and environment