improve contexts/api.php
improve contexts/api.php

 * system startup error handling
 * /{scheme}/{path} API URI format
 * json encode error
 * $query may take $_POST as well as $_GET

koriym/BEAR.Package