add get and post method for Posts model