Move pid checking/creation to middleware layer
Merge pull request #4 from rcourtie/add_pid_middleware

Move pid checking/creation to middleware layer