finished server-side API