implement GET /api/posts/{id} endpoint