server api function