Thanks for your response it took me a while to respond because I am still trying to fully understand the implementation you suggested. My understanding is that:
I assume this setup would work for any client app (Java, Python etc). I will look at the util::Webserver api to see how to spawn a server in Rascal if there are any examples I will be extremely glad if you can point me to it. I already have some experience working with lang::json::IO. Thanks once again this is very useful.