Cleanup configuration
Generate json when using external server