[GS, MP, PT]{other} - modified api.php, prepared unit tests