Manage lifecycle of server resources
Fix #41