initial code for server side API