Make the API nicer by introducing request and response objects.