Most simple JSON API builder class for PHP. One file only. Accepting a JSON request body and returning JSON as a result.
<?php
require __DIR__ . '/../vendor/autoload.php';
$server = new Fordnox\JsonApiServer();
$server->register('ping', function($params){
return $params;
});
$server->handle();
curl http://api.com -d '{"method":"ping","params":"pong!"}'
{"result":"pong!", "error":null}