Fix/verify pid

Verify if the pid is valid only when the job is started to avoid error 500
Fix #30 

Unit tests OK