Switch dotenv loading order.
Cleanup pg secret.
Added validation and flash to saving.