server code written. needs testing