I am making an Android app that connects to a web service via REST API and I have a dilemma with the design of the internal architecture.

Now I have class Client.java whose purpouse is make connect with the server (ConnectionMethod is Enum that contains GET|POST values):

```
public class Client {
private AsyncHttpClient client = new AsyncHttpClient(); //I use com.loopj.AsyncHttpClient to connect
private ConnectionMethod method;
private RequestParams params = new RequestParams();
private AsyncHttpResponseHandler responseHandler = new JsonHttpResponseHandler(){
    @Override
    public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
        //Actions when connection success
    }
    @Override
    public void onFailure(int statusCode, Header[] headers, JSONObject response, Throwable error) {
        //Actions when connection fails
    }
};

public Client (RequestParams params, ConnectionMethod method) {
    this.params = params;
    this.method = method;
}

public void addParameters (Map<String, String> parameters) {
    for (Map.Entry<String, String> entry : parameters.entrySet()) {
        this.params.put(entry.getKey(), entry.getValue());
    }
}

public ServerResponse connect () {
    RequestHandle handle;

    if (this.method==ConnectionMethod.POST) {
        handle = postRequest();
    }
    else {
        handle = getRequest();
    }
    //How can I treat here different type of responses homogeneously?
}

private RequestHandle getRequest () {
    return client.get(Constants.getEndpoint(), this.params, this.responseHandler);
}

private RequestHandle postRequest () {
    return client.post(Constants.getEndpoint(), this.params, this.responseHandler);
}
}

```

A sample method that requests info from the server is this:

```
public static void login (String login, String password) {
//This classes should be static or dynamic?
    Map<String, String> map = new HashMap<String, String>();

    map.put("login", login);
    map.put("password", password);
    map.put("method", "site_login");

    Client c = new Client();
    c.addParameters(map);
    c.getRequest();
}

```

All server responses are JSON: {status:0, result:array/int/string} when response is correct and {status:-1, message:string} when response is incorrect.

Additionaly I want to make classes to model components from JSON result (User.java, Message.java...) and intermediate methods between UI and API to implement the logic of the app and classes.

What is the best way to design an homogeneous connection system that manages automatically correct/fail response and independent of model (user, message...)?