finishing server api, replacing NA with -1