wrapped the server site with a function - js style callback