fix scope-bug in api-server, - make sure that data in outer scope is updated when we get incoming data from the preparation server