Refactor HTTP handling code
Make sure resource files are loaded before using them.