title: A question about api design between FE and BE
body: <p>I'm building a FE-BE app and i came up with some questions about the design of the api between them.</p>
  <p>Let's say i'm developing a library application that has 2 screens:</p>
  <ol>
  <li>add book {author: string, name: string}</li>
  <li>display of the books in the library + the number of copies that exists for each book in all of the
  libraries in the city</li>
  </ol>
  <p>The BE:</p>
  <ol>
  <li>stores the new books in the DB</li>
  <li>sends a book/list of books to the FE</li>
  <li>calls a 3rd party api to get the sum of copies of a book in all of the libraries in the city</li>
  </ol>
  <p><strong>So my 2 questions are:</strong></p>
  <p>a. when the FE gets books from the BE (GET), each book has id (the id it got when stored in the DB), but when the FE creates a new book and passes it to the BE (POST), it doesn't have any id yet.
  So should i just put null in the id when passing the new book in the POST request or should I create 2 object types (BookWithId and BookWithoutId)?</p>
  <p>b. The number of copies of a book (in all of the city libraries) which is received in the BE via a 3rd party api should be a field in the Book object, so it can be passed to the FE with the book in the GET request, or should the FE request it from the BE through a separate api?</p>