api: refactors function and parameter name
test_api: reloading api module after setting database environment var