Updated api to use tornado. Fixed self_signed_cert to use configured common_name