Refactored the endpoints and added a client.