hivend server side code take 2