Fix extra space in posts controller
Improve robustness: null post, null id

Changed empty array to Post.none for null post
Changed false to -1 for null id