Added server-side api code