RhinoCompute service is not working properly in first call!

When I run the ehino.compute service ,and then run below code, I do not get the correct outputs in the first run. ONLY If I execute the same code again , then I would have the correct outputs , any idea what is going on?

string rhinoComputeUrl = "http://localhost:6500";
string ghFilePath = @"C:/myscript.gh";
string encodedContent = EncodeFileToBase64(ghFilePath);
var options = new RestClientOptions(rhinoComputeUrl)
    Timeout = TimeSpan.FromMinutes(10)
var client = new RestClient(options);

var request = new RestRequest("grasshopper", Method.Post);
request.AddHeader("Content-Type", "application/json");

var payload = new
    algo = encodedContent,
    pointer = (string)null,
    values = new List<object>()


RestResponse response = await client.ExecuteAsync(request);