Casted to correct type in Server class
Added debugging info
Implemented read/write of native java arrays