Consolidated various functions such as http_post