[minor] prepare for testing
[fix] correctly set the options
[fix] only set the options if they exist
[fix] correctly add server
[fix] only remove listeners if they exist