Implement the 'Update' functionality using a PUT endpoint to replace an existing resource.
The 'Update' operation allows clients to modify an existing resource. In a RESTful API, this is typically handled by the `PUT` HTTP method. A `PUT` request is directed at the specific URI of the resource to be updated, for example, `PUT /books/{book_id}`. A key characteristic of `PUT` is that it's idempotent and performs a full replacement. The client is expected to send the complete representation of the updated resource in the request body. The server then replaces the entire existing resource with this new representation. Our endpoint logic will first need to find the book with the specified `book_id`. If the book doesn't exist, it should return a `404 Not Found` error. If the book is found, we will update its data in our in-memory store with the data from the request payload. It's important that the ID remains the same. After a successful update, the API should return a `200 OK` status code, and it's good practice to return the updated representation of the resource in the response body. This confirms to the client exactly what the new state of the resource is. While `PATCH` is used for partial updates, `PUT` is the standard for a complete replacement, ensuring a predictable and consistent way to modify data.