Writing api Resource spec.