Refactor and consolidation. Use HttpReuqest and HttpResponse for RestClient. Fix PMD, find bugs.