Move env require to main
Add test for add_db