Updated _makeRequest so that it'll handle JSON and XML requests and responses