changes ...

 o centralized code used to test various rest resources
 o same code will be used by both test cases and integration tests
 o fixed issue with return of proper json messages with result codes