changed docs and some refactoring
refactored dispatcher and moved thrown exception higher so an error is detected earlier
changed the way errors are returned, removed exceptions