Add unit tests.

Touching process.env in this scope looks racy. We probably have no other tests that could fail due to process.env['API_HOST'] and process.env['API_PORT'], that's how you didn't recognise it.