function getPostById implemented