Added better checking of content type in Server.php