added error handling for invalid server types and fixed minor constructor bug