filling in the rest of the server side code.