functions for exporting config (for frontend), error handling for port-in-use error