adding put and delete methods into posts model