Move executed stuff into main guard and rename getKey to get_key
Add database persistence of traffic