Hmm, Api\Config automatic encodes and decodes arrays or objects.
Api\Config::read($app) reads from the cache, and only if it does not find it in the cache, eg. because you cleared the cache, it reads AND decodes it from the database. The cache itself allows to store arrays and de- and encodes them automatically. While the DB only stores strings, we have to do that manually.
Most easy is NOT to (manually) json_encode the config-values, and leave it to Api\Config to store them. When you need to send it somewhere, you json_encode it before sending.