Documentation, new Enums, changed Error handling

Added some missing documentation and changed some of the deprecated.
New enums as described in the server manual pdf added.
Changed the way errors are handled, to be more flexible in the implementing program.