Added thread sigint handler and http error handling