Checking http header returned from server for mime type. Removed unnecessary if clause. Turned on -O2 in CMakeLists.txt