Code refactored: init_globals

Using init_globals from restlib consistently