a fork from https://wordpress.org/plugins/json-api/