api to server