recodeing the server side with q library