json api for blog, made methods for models