server api code done