1. A method of executing an application on a server-client network based operating environment, the method comprising: issuing events to authored code of an application, the authored code being adapted to invoke APIs on a server in a non-distributed operating environment to interact with a user or process; collecting a plurality of APIs invoked by the authored code relevant to a task to be performed, wherein collecting comprises detecting when the authored code has invoked all the APIs needed for the task for each of a plurality of client devices by monitoring an operation of the server, wherein monitoring comprises monitoring threads of the server including monitoring release of a thread of the authored code for the task, wherein the state of the authored code is maintained for the plurality of client devices communicating with the server and executing the authored code; generating, with a processor of a computer, mark-up language based on the plurality of collected APIs to perform the task, wherein generating the mark-up language occurs after release of the thread; sending the generated mark-up language to a client device; receiving a client result from the client device based on rendering the mark-up language on the client device; and providing at least one of a result and an event to the authored code based on the client result from the client device, wherein the at least one of a result and an event is provided in the same form as compared to at least one of a result and event provided to the authored code from the server when the authored code is executed in the non-distributed operating environment.