add phpmd and new phpcs
fix phpstorm notices

and move routes to app
add phpunit
add unit test
fix syntax error