Refactored Android-REST API code