Further work on server. Still some problems with converting to ByteArrays