Adding new endpoints to the API. Moving logic from frontend to backend.