Added error handling on listen and serve calls