PHP 5.4 built-in webserver support

I use PHP 5.4 command line dev server for API development.
I added the code to the necessary elements.
i added content-type handling and script name elements.

usage: php -S localhost:8000 index.php