Allow authentication by api_key

Currently the authentication by api_key is only allowed in RpcController.
It would be useful if other API (e.g., /api/pin/all) can be accessed by api_key.