THis code only successfully prints out the first line input into the server, and not any lines after that. 
int main() {
    setbuf(stdout, NULL);

    struct sockaddr_in *self = init_server_addr(PORT);
    int listenfd = set_up_server_socket(self, 5);

    while (1) {
        int fd = accept_connection(listenfd);
        if (fd < 0) {
            continue;
        }

        // Receive messages
        char buf[BUFSIZE] = {'\0'};
        int inbuf = 0;           // How many bytes currently in buffer?
        int room = sizeof(buf);  // How many bytes remaining in buffer?
        char *after = buf;       // Pointer to position after the data in buf

        int nbytes;
        while ((nbytes = read(fd, after, room)) > 0) {
            // Step 1: update inbuf (how many bytes were just added?)
            inbuf = nbytes;

            int where;

    
            while ((where = find_network_newline(buf, inbuf)) > 0) {
            
                buf[where-1] = '\0';
                printf("Next message: %s\n", buf);
                // Note that we could have also used write to avoid having to
                // put the '\0' in the buffer. Try using write later!

                // Step 4: update inbuf and remove the full line from the buffer
                // There might be stuff after the line, so don't just do inbuf = 0.
                inbuf = inbuf-where;
                memmove(buf, &buf[where], BUFSIZE-where);

                // You want to move the stuff after the full line to the beginning
                // of the buffer.  A loop can do it, or you can use memmove.
                // memmove(destination, source, number_of_bytes)
            }
            // Step 5: update after and room, in preparation for the next read.
            after = &buf[inbuf];
            room = BUFSIZE - inbuf;
        }
        close(fd);
        printf("The connection is now closed ...\n");
    }

    free(self);
    close(listenfd);
    return 0;
}
