Added route error handling to posts route