Add timeout argument to mg_get_response() function