I have succesfully deployed algos in C# using lean on the quantconnect.com IDE and in visual studio on my local machine. 

I would now like to deploy a server that can take in an algo's C#/LEAN source code and run it as a backtest, before doing something with the results. 


I was wondering whether anyone had any experience doing this, or suggestions on how to appraoach the problem? Obviously, the key is to take in some code as a parameter to the server, then execute it in a backtest and return the backtest results in some format. 


I was thinking maybe QuantConnect have an API where I can pass in a c# project and then it would execute this code via a backtest and return the results to me- seemingly similar to how quantconnect.com works. Is this a viable approach or would it not be possible/would something be better?


Many thanks