created posts controller to show posts