Updated the whole structure of the server. All structs now use typedef. Furthermore the server has been refactorized and a couple of bugs has been fixed.