public JSONObject details(int id, boolean isUser, boolean isForum, boolean isThread) {
        JSONObject result = new JSONObject();
        JSONObject response = null;
        ResultSet resultSet;

        try {
            PreparedStatement stmt = con.prepareStatement("SELECT message, date, likes, dislikes, points, isApproved, isHighlighted, isEdited, isSpam, isDeleted, parent, user, thread, forum FROM posts WHERE id = ?");
            stmt.setInt(1, id);

            resultSet = stmt.executeQuery();
        if (resultSet.next()) {

            response = new JSONObject();

            response.put("id", id);
            response.put("message", resultSet.getString("message"));
            response.put("date", resultSet.getString("date").split("\\.")[0]);
            response.put("likes", resultSet.getInt("likes"));
            response.put("dislikes", resultSet.getInt("dislikes"));
            response.put("points", resultSet.getInt("points"));
            response.put("isApproved", resultSet.getBoolean("isApproved"));
            response.put("isHighlighted", resultSet.getBoolean("isHighlighted"));
            response.put("isEdited", resultSet.getBoolean("isEdited"));
            response.put("isSpam", resultSet.getBoolean("isSpam"));
            response.put("isDeleted", resultSet.getBoolean("isDeleted"));
            response.put("parent", Api.checkNullValue(resultSet.getInt("parent")));

            if (isUser) {
                response.put("user", UserDAO.details(resultSet.getString("user"), con));
            }
            else { response.put("user", resultSet.getString("user")); }
            if (isThread) {
                response.put("thread", ThreadDAO.details(Integer.parseInt(resultSet.getString("thread")), false, false, con));
            }
            else { response.put("thread", resultSet.getInt("thread")); }
            if (isForum) {
                response.put("forum", ForumDAO.details(resultSet.getString("forum"), null, con));
            }
            else { response.put("forum", resultSet.getString("forum")); }
        }


            if (response != null) {
                result.put("code", 0);
                result.put("response", response);
            } else {
                result.put("code", 1);
                result.put("message", "post not found: " + id);
            }
        } catch (JSONException | SQLException e) { }

        return result;
    }