added method for getting responses from the server