fixed arrayoutofbounds error on some threads
moved mocks
cleanup. added abstraction for request parsing.  tests are improved