Introduce `WP_JSON_Resource` for accessing resources

No space between `else` and `if`