added controller to posts.js